#ifdef USB_DLL_PROJ
#define DLL_EXT __declspec(dllexport)
#else
#define DLL_EXT __declspec(dllimport)
#endif

class DLL_EXT usb
{
public:
	typedef void (*OnSaveDateEvent)(unsigned short * pDst, const int dstLen);
	OnSaveDateEvent m_onSaveDataEvent;
	usb();
	~usb();
	bool OpenDevice();
	bool RegsReadWrite(bool rw_flag, unsigned char addr, unsigned short &data);//
	bool StartAcq();//
	bool StopAcq();//
	bool ClkChange(unsigned char clk_sel);
	bool DutyChange(unsigned char duty_sel);
	bool DataFormatChange(unsigned char data_format_sel);
	bool ChannelNumChange(unsigned char chan_num_sel);
	bool DataWidthChange(unsigned char data_width_sel);
	bool BurstContinueChange(unsigned char burst_conti_sel);
	bool TrigEnableChange(unsigned char trig_enable);
	bool TrigModeChange(unsigned char trig_mode);
	bool TrigVoltChange(unsigned char trig_volt);
	bool TrigPositionChange(unsigned char trig_posi);
	bool ChannelNumGet(unsigned char &chan_num_get);
	bool DataWidthGet(unsigned char &data_width_get);
	bool TrigFinish(unsigned char &trig_finish);
	bool DataRecv(unsigned char *buf, long &buflen); //
	void SaveData(const char * path);
private:

	void recv_proc(const char * path);
	void burst_recv_proc(); // not implent
	bool m_isAcqing;
};


#define VENDOR_ID 0x04B4
#define PRODUCT_ID 0x00F1
#define BUF_BLOCK_SIZE  16*1024
#define BUF_BLOCK_NUM  64